﻿{% extends "base.html" %}
{% load tags %}
{% block title %}Projekto biudžeto ataskaita{% endblock %}
{% block pickDate %}{% include "monthPicker.html" %}{% endblock %}
{% block content %}
<h1 class="headerText">Projekto biudžeto vykdymo ataskaita</h1>
{% if image %}<img src="{{ image }}" />{% endif %}
<br />
<br />
<table class="sortable reportTable" >
  <thead>
    <tr>
      <th sort_index="0" rowspan="2">Data</th>
      <th sort_index="1" rowspan="2">Biudžetas (val.)</th>
      <th sort_index="2" rowspan="2">Išnaudota (val.)</th>
      <th colspan="2">Likutis / Viršijimas</th>
    </tr>
    <tr>
      <th sort_index="3">val.</th>
      <th sort_index="4">%</th>
    </tr>
  </thead>
  <tbody>
    {% for p in project %}
    <tr class="{{ forloop.counter|oddOrEven }}">
      <td>{{ p.date|date:"Y-m" }}</td>
      <td>{{ p.total }}</td>
      <td>{{ p.used }}</td>
      <td>{{ p.left }}</td>
      <td>{% ifequal p.percent None %}&#8734;{% else %}{{ p.percent|floatformat:1 }}{% endifequal %}</td>
    </tr>
    {% endfor %}
  </tbody>
  <tfoot>
    <tr>
      <td>Viso:</td>
      <td>{{ project|columnTotal:"total" }}</td>
      <td>{{ project|columnTotal:"used" }}</td>
      <td>{{ project|columnTotal:"left" }}</td>
      <td>{{ project|columnFreetime:"left,total" }}</td>
    </tr>
  </tfoot>
</table>
{% endblock %}
